Printed: Apr 30, 2025
From: http://www.jcp.org/en/jsr/detail?id=133
|
Specification Leads | |||
William Pugh | Pugh, William | ||
![]() |
|||
Expert Group | |||
Adve, Sarita | Hewlett-Packard | IBM | |
Lea, Doug | Oracle | Pugh, William |
Updates to the Original Java Specification Request (JSR)
The following updates have been made to the original JSR.
It is intended that this JSR will be delivered as part of the J2SETM "Tiger" release.
2004.10.01:
Specification Lead: William Pugh
E-Mail Address: pugh
Telephone Number: +1 301 405 2705
Fax Number: +1 301 405 6707
Original Java Specification Request (JSR)
Identification |
Request |
Contributions
Section 1. Identification Submitting Member: Sun Microsystems, Inc.
Name of Contact Person: Tim Lindholm
E-Mail Address: Timothy.Lindholm@sun.com
Telephone Number: 408-343-1441
Fax Number: 408-343-1482
Specification Lead: Tim Lindholm
E-Mail Address: Timothy.Lindholm@sun.com
Telephone Number: 408-343-1441
Fax Number: 408-343-1482
Note that this information has been updated from this original proposal.
Initial Expert Group Membership:
(Please provide company or organization names. Note that expert group
members must have
signed
the JSPA.)
Section 2: Request
The proposed specification describes the semantics of threads, locks, volatile variables and data races. This includes what has been referred to as the Java memory model.
The specification is expected to revise substantially Chapter 17 of "The Java Language Specification" and Chapter 8 of "The Java Virtual Machine Specification". It is not expected to result in changes to existing APIs, but might clarify the semantics of some existing methods in java.lang.Thread and java.lang.Object (java.lang.Object defines the wait and join methods).
All platforms.
Given that the Java programming language and Java virtual machine are affected, the revision must be accepted into an umbrella JSR for the J2SE platform for the changes to be made available.
Not all users of Java technologies will be directly affected by the change. For instance Enterprise Java Beans are constrained to be single threaded, so the revision is not expected to impact EJB developers (but is likely to impact developers of EJB containers, which are typically multithreaded).
Users of the Java programming language need to be able to write reliable multithreaded software and understand which thread communication idioms are legal.
Java virtual machine (JVM) implementors need to be able to implement high-performance JVMs without violating the JVM specification.
Chapter 17 of "The Java Language Specification" (repeated as Chapter 8 of "The Java Virtual Machine Specification") currently specifies the semantics of threads and locks, as well as related features such as volatile variables.
Unfortunately, the current specification has been found to be hard to understand and has subtle, often unintended, implications. Certain synchronization idioms sometimes recommended in books and articles are invalid according to the existing specification. Subtle, unintended implications of the existing specification prohibit common compiler optimizations done by many existing Java virtual machine implementations. Enforcing these aspects of the specification would be prohibitively expensive on many existing processor architectures. It is doubtful that enforcement of these implications would be useful to programmers, regardless of the cost of enforcing them. Several important issues, such as the interaction between synchronization and final fields, simply aren't discussed in the existing specification.
Goals of the specification revision:
No -- no new APIs are anticipated; any clarification of existing APIs (e.g. java.lang.Thread) should not necessitate renaming them.
Many of the most surprising behaviors of a multithreaded program can happen only on a shared memory multiprocessor with a weak memory model. The cost of strengthening the specification is anticipated to be highest on such systems, but should not preclude their effective use of Java technologies.
One issue to be addressed in the revised specification is that under the current specification, immutable objects (such as String instances) might be observed to change, potentially compromising security. This problem will be fixed in the proposed specification.
No.
Chapter 17 of "The Java Language Specification" and Chapter 8 of "The Java Virtual Machine Specification" are proposed to be revised substantially. Supplementary changes might be needed elsewhere in those specifications. Clarification to the specification for java.lang.Thread and java.lang.Object might also prove appropriate.
Such changes will strive to retain as clearly valid all patterns that are valid according to the existing specification and in significant use in deployed Java software. Thus, existing binary applications that exclusively make use of currently valid coding idioms should run unchanged. The effort will also attempt to make valid certain currently illegal idioms that are occasionally used nonetheless by the community, if it is possible to do so economically. Where that is impossible, the spec will clarify that the idioms are invalid and should not be used.
Initiation: June 2001
Community Review: October 2001
Public Review: November 2001
Final Draft Proposal: January 2002
Note that this section has been updated since the original JSR.
We anticipate a working style, if agreed upon by the expert group, that encourages review and feedback from outside the expert group as early in the process as feasible. Such a style will provide continuity with the efforts to date, which have taken place outside of the JCP.
Section 3: Contributions
Discussion of the issues in this JSR has been ongoing for some time. Some of this discussions have taken place on the Java Memory Model mailing list. The Java Memory Model web page (http://www.cs.umd.edu/~pugh/java/memoryModel) contains archives of those discussions, as well as links to related resources. Some of the relevant resources:
The work listed above could be used as contributions toward an initial draft. Where it falls short of stated goals or constraints, further work will be needed by the Expert Group to determine the best course of action.